]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/location: Remove submenu
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 27 Jul 2022 02:38:21 +0000 (04:38 +0200)
committerMarge Bot <marge-bot@gnome.org>
Mon, 1 Aug 2022 12:33:36 +0000 (12:33 +0000)
Location services aren't expected to change frequently: They are
either disabled globally, or permissions are granted on a per-app
basis.

This is less of a concern while the setting is exposed in a small
submenu, but as we moving to quick settings, it does not deserve
the prominence of a quick toggle. Just the top bar icon and Settings'
privacy panel should be enough.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2391>

js/ui/status/location.js

index aa849d64ae1aed1f63704e15a7e76bc9e7380b99..52f374fb20292caffdbdc0a129e449cb4bfe0615 100644 (file)
@@ -4,9 +4,7 @@
 const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
 
 const Dialog = imports.ui.dialog;
-const Main = imports.ui.main;
 const PanelMenu = imports.ui.panelMenu;
-const PopupMenu = imports.ui.popupMenu;
 const ModalDialog = imports.ui.modalDialog;
 const PermissionStore = imports.misc.permissionStore;
 
@@ -220,44 +218,6 @@ class Indicator extends PanelMenu.SystemIndicator {
             this._indicator,
             'visible',
             GObject.BindingFlags.SYNC_CREATE);
-
-        this._item = new PopupMenu.PopupSubMenuMenuItem('', true);
-        this._item.icon.icon_name = 'find-location-symbolic';
-        this._agent.bind_property('in-use',
-            this._item,
-            'visible',
-            GObject.BindingFlags.SYNC_CREATE);
-
-        this._item.label.text = _('Location Enabled');
-        this._onOffAction = this._item.menu.addAction(_('Disable'),
-            () => (this._agent.enabled = !this._agent.enabled));
-        this._item.menu.addSettingsAction(_('Privacy Settings'), 'gnome-location-panel.desktop');
-
-        this.menu.addMenuItem(this._item);
-
-        this._agent.connectObject(
-            'notify::enabled', () => this._sync(),
-            'notify::in-use', () => this._sync(), this);
-
-        Main.sessionMode.connect('updated', this._onSessionUpdated.bind(this));
-        this._onSessionUpdated();
-    }
-
-    _onSessionUpdated() {
-        let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
-        this.menu.setSensitive(sensitive);
-    }
-
-    _sync() {
-        if (this._agent.enabled) {
-            this._item.label.text = this._indicator.visible
-                ? _('Location In Use')
-                : _('Location Enabled');
-            this._onOffAction.label.text = _('Disable');
-        } else {
-            this._item.label.text = _('Location Disabled');
-            this._onOffAction.label.text = _('Enable');
-        }
     }
 });